package sch.frog.creational.prototype.entity;

public class ObjectA implements Cloneable{

    private int a;

    private int b;

    public ObjectA() {
    }

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    public int getB() {
        return b;
    }

    public void setB(int b) {
        this.b = b;
    }

    @Override
    public String toString() {
        return "ObjectA{" +
                "a=" + a +
                ", b=" + b +
                '}';
    }

    @Override
    public ObjectA clone(){ // since jdk1.5, 协变返回值类型
        try {
            return (ObjectA) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }

}
